import type { DirectiveBinding } from "vue"


//v-my-color="'pink'"
export const myColor = {
  // DOM 挂载时触发
  mounted(el: HTMLElement, binding: DirectiveBinding<string>) {
    el.style.color = binding.value
  },

  // DOM 更新时触发
  updated(el: HTMLElement, binding: DirectiveBinding<string>) {
    el.style.color = binding.value
  }
}